// YUVAnalyzerDlg.h : header file
//

#if !defined(AFX_YUVANALYZERDLG_H__5CF3D687_DE3A_40E2_B4BB_92356F153B0D__INCLUDED_)
#define AFX_YUVANALYZERDLG_H__5CF3D687_DE3A_40E2_B4BB_92356F153B0D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "CDXCSIZINGDIALOG.H"
#include "YUVplayback.h"
#include "Convert.h"
#include "resource.h"

/////////////////////////////////////////////////////////////////////////////
// CYUVAnalyzerDlg dialog

enum { YUV, YY, UU, VV };

class CYUVAnalyzerDlg : public cdxCSizingDialog
{
// Construction
public:
	CYUVAnalyzerDlg(CWnd* pParent = NULL);	// standard constructor
	void OpenFileA();

// Dialog Data
	//{{AFX_DATA(CYUVAnalyzerDlg)
	enum { IDD = IDD_YUVANALYZER_DIALOG };
	CStatic	m_psnr;
	CButton	m_grid;
	CButton	m_YUV;
	CButton	m_orig_size;
	CYUVPlayback	m_playbackAA;
	CButton	m_bMV;
	CYUVPlayback	m_playbackB;
	CYUVPlayback	m_playbackA;
	CButton	m_single_dual;
	CButton	m_setting;
	CButton	m_play_pause;
	CStatic	m_frame_num;
	CSliderCtrl	m_progress;
	//}}AFX_DATA

	int iWidth,iHeight;	// YUV file width & height setting by m_setting
	int fps;			// frame per second
	UINT playback_timer;// timer for fps
	BOOL bPlay;			// play or pause;
	BOOL bDual;			// single window or dual window
	int  bYUV;		// display Colorful YUV or Y only or U only or V only
	int iCurrFrameNumber;	// current frame number, start from 0, 1, 2, ......
	char sFileNameA[128];	// 
	char sFileNameB[128];	// 
	int iTotalFrameNumberA;	//
	int iTotalFrameNumberB;	//
	int	iMaxFrameNumber;	// maxium frame number of A & B

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CYUVAnalyzerDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CYUVAnalyzerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	afx_msg void OnSingleDual();
	afx_msg void OnPlay();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnReleasedcaptureProgress(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSetting();
	afx_msg void OnMV();
	afx_msg void OnOrigSize();
	afx_msg void OnYUV();
	afx_msg void OnGrid();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void Restart(void);
	float CalcPSNR(unsigned char *A, unsigned char *B, int yuv);
	void OnNext();
	void OnPrev();
	void ShowPSNR();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_YUVANALYZERDLG_H__5CF3D687_DE3A_40E2_B4BB_92356F153B0D__INCLUDED_)
